#定义set集合
set1 =set([1,2,3])
print(set1)

#添加元素
set1.add(4)
print(set1)

#删除元素
set1.remove(4)
print(set1)

#交集与并集的计算
set2 =set([1,2,4])
print('set2 = ',set2)
#交集
set3 = set1 & set2
print('set3 =',set3)

#并集
set4 = set1 | set2
print('set4 = ',set4)